﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using System.Web.Script.Serialization;



namespace Kooboo.Commerce
{
    public static class JsonSerializer
    {
        static readonly JavaScriptSerializer Serializer = new JavaScriptSerializer();

        public static string SerializeToJson(this object obj)
        {
            return Serializer.Serialize(obj);
        }

        public static T Deserialize<T>(string json)
        {
            return Serializer.Deserialize<T>(json);
        }
    }
}